package initialize

import (
	"fmt"
	"github.com/redis/go-redis/v9"
	"hosptial-record/global"
)

func InitRedis() {
	// 创建客户端
	global.RDB = redis.NewClient(&redis.Options{
		Addr:     fmt.Sprintf("%s:%d", global.ServerConfig.RedisConfig.Host, global.ServerConfig.RedisConfig.Port),
		Password: global.ServerConfig.RedisConfig.Password,
		DB:       0,
	})
}
